package com.cqupt.interrgation.cquptinterrgation.service;

import com.cqupt.interrgation.cquptinterrgation.entity.User;
import com.cqupt.interrgation.cquptinterrgation.mapper.Usermapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service//注入springboot里
public class Userservice {

    @Autowired
    private Usermapper usermapper;

    public int save(User user){
        if(user.getId() == null){
             return usermapper.insert(user);
        }else{
           return usermapper.update(user);
        }
    }

}
